package com.it.myd.bean.box.world.Items;

import com.it.myd.bean.box.world.*;


public class Axe extends Item {
    public Axe() {
        this.setName("斧头");
        this.setType("tool");
        this.setRegion("hands");
        this.setCount(1);
        this.setIsStack("0");
        this.setState("0");
        Prefix prefix = new Prefix();
        Ability a = new Ability();
        prefix.setType("tool");
        prefix.setAbility(a);
        this.setPrefix(prefix);
    }

    @Override
    public Ability useItem(Ability a,MyObject obj) {
        Ability ab = new Ability();
        if(obj.getType().indexOf("tree")>=0){
            ab.setStrength(a.getStrength() * super.getLevel());
            ab.setSpeed(a.getSpeed());
        }
        ab = ab.addAbility(a);
        return ab;
    }

}
